const mysql = require('mysql');
const connection = mysql.createConnection({

    host     : '127.0.0.1',       //主机
    user     : 'root',            //MySQL认证用户名
    password:'root',
    port:   '3306',
    database: 'node'
});
//创建一个connection
connection.connect(function(err){
    if(err){
        console.log('[query] - :'+err);
        return
    }
    console.log('[connection connect]  succeed!');
});
exports.connection = connection;